
$(function () {
    var devId=localStorage.id;
    var type=localStorage.type;
    var url=localStorage.url;
    //初始化页面

    $.ajax({
        type: "get",
        url: url+"/boss/base/userinfo",
        data: {id:devId,type:type},// 要提交的表单,
        dataType:'json',
        success: function (msg) {
            if(msg.status=='ok!'){
                $('#usrname').html(msg.msg.name);
                localStorage.devName=msg.msg.name;
                localStorage.userId=msg.msg.id_number;
                localStorage.devKey=msg.msg.devKey;

            }
            console.log(msg.msg);
        },
        error: function (error) {
            console.log('登录出错！');
        }
    });
    $('#frame').load('devAdManage.html');


});
function skip(url) {
    $("#frame").load(url);

}
function toChangePassword(){
    $("#id").val(localStorage.id);
    $("#type").val(2);
    var obj=$("#exampleModalLabel1").serialize();
    $.ajax({
        type: "get",
        url:  localStorage.url+"/boss/base/changepwd",
        dataType:"json",
        data: obj,// 要提交的表单
        success: function (msg) {
            if(msg.status=="ok!"){
                alert("修改成功！请重新登录");
                window.location.href="index.html";
            }
            else{
                alert("修改失败，原密码输入错误");

            }



        },
        error: function (error) {

        }
    });
}